package com.czk.service.impl;

import com.czk.annotation.CzkTransaction;
import com.czk.dao.UserDao;
import com.czk.service.UserService;
import com.czk.utils.HttpClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/4/6 14:07
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    @Transactional
    @CzkTransaction(isStart = true)
    @Override
    public void insert(String name) {
        userDao.insert(name);
        HttpClient.get("http://localhost:8082/server2");
      //  int i = 100/0;
    }
}
